﻿using System;
using Services;
using System.Xml;
using System.Xml.Linq;
using System.Collections.Generic;
using System.Collections;

namespace web
{
    public partial class _Default : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            /*TweetService servicio = new TweetService();
            String tweets = servicio.getAllTweetsFrom(Request.Params["user"]);
            Response.ContentType = "text/json";
            Response.AppendHeader("Access-Control-Allow-Origin", "*");
            Response.Write(tweets);
            Response.End();**/

           
            var token = Request["token"];
            if (!string.IsNullOrEmpty(token))
            {
                Rpx rpx = new Rpx("75984a6c028c1996e212b16109d40b148711459d","https://mymvcapp.rpxnow.com/");
                XmlElement response = rpx.AuthInfo(token);
                Response.Write(new LoginService().login(response));
                Response.Redirect("file:///D:/Dropbox/ORT/ULTIMO%20CUATRIMESTRE/Taller/twitter-Taller/Login.xhtml");
            }
            Response.Redirect("error.html");
        }
    }
}
